/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.paroquiadegloria.ejc.view.util;

import java.util.Map;
import javax.el.ELContext;
import javax.el.ExpressionFactory;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;

/**
 *
 * @author jadson
 */
public class ContextApp {
    
    private static FacesContext context;
    private static ExternalContext externalContext;
    
    public static FacesContext getContext(){
        return FacesContext.getCurrentInstance();
    } 
    
    public static ExternalContext getExternalContext(){
        return getContext().getExternalContext();
    }
    
    public static Map<String, Object> getMapSession(){
        return getExternalContext().getSessionMap();
    }
    
    public static ExpressionFactory getExpressionFactory(){
        return getContext().getApplication().getExpressionFactory();
    }
    
    public static ELContext getELContext(){
        return getContext().getELContext();
    }
    
}
